! function (e) {
  e.extend(e.fn, {
    cookie: function (t, n, o) {
      var a, r, i, c;
      return arguments.length > 1 && "[object Object]" !== String(n) ? (o = e.extend({}, o), (null === n || void 0 === n) && (o.expires = -1), "number" == typeof o.expires && (a = 24 * o.expires * 60 * 60 * 1e3, r = o.expires = new Date, r.setTime(r.getTime() + a)), n = String(n), document.cookie = [encodeURIComponent(t), "=", o.raw ? n : encodeURIComponent(n), o.expires ? "; expires=" + o.expires.toUTCString() : "", o.path ? "; path=" + o.path : "", o.domain ? "; domain=" + o.domain : "", o.secure ? "; secure" : ""].join("")) : (o = n || {}, c = o.raw ? function (e) {
        return e
      } : decodeURIComponent, (i = new RegExp("(?:^|; )" + encodeURIComponent(t) + "=([^;]*)").exec(document.cookie)) ? c(i[1]) : null)
    }
  })
}(Zepto);
var goome = window.goome || {};
goome.wx = goome.wx || {}, goome.wx.config = goome.wx.config || {
    version: 1,
    debug: !1,
    apiUrl: "http://api.gpsoo.net/1/",
    status: {
      0: wxLang.deviceStatus.s0,
      1: wxLang.deviceStatus.s1,
      2: wxLang.deviceStatus.s2,
      3: wxLang.deviceStatus.s3,
      4: wxLang.deviceStatus.s4
    }
  }, window.location.href.indexOf("https") > -1 && (goome.wx.config.apiUrl = "https://api.gpsoo.net/1/"), goome.wx.utils = goome.wx.utils || {
    mapTypeOptions: function () {
      var e = goome.wx.utils,
        t = e.params(),
        n = t.map_type,
        o = document.createElement("ul"),
        a = [];
      o.id = "map-type-options", o.className = "map-types", a = "BAIDU" == n ? ['<li class="first" title="切换到谷歌地图" data-map="GOOGLE"><p>' + wxLang.google + "</p></li>", '<li class="last on"><p>' + wxLang.baidu + "</p></li>"] : ['<li class="first on"><p>' + wxLang.google + "</p></li>", '<li class="last" title="切换到百度地图" data-map="BAIDU"><p>' + wxLang.baidu + "</p></li>"], o.innerHTML = a.join(""), document.getElementById("map-container").appendChild(o), $("#map-type-options li").on("click", function () {
        var e = $(this),
          t = e.data("map");
        e.hasClass("on") || (location = location.href.replace("map_type=" + n, "map_type=" + t))
      })
    },
    writeScripts: function (e) {
      for (var t = 0, n = e.length; n > t; t++) document.write('<script src="' + e[t] + '"></script>')
    },
    alert: function (e, t, n) {
      if (t = t || "", n = n || "", "[object Object]" == Object.prototype.toString.call(e))
        if ("undefined" != typeof e.errcode) {
          if (20002 == e.errcode && -1 === location.href.indexOf("access_token")) return alert(wxLang.needLogin), void(location.href = "index.shtml");
          alert(t + "[" + e.errcode + ": " + (e.msg || wxLang.systemError) + "]" + n)
        } else alert(wxLang.systemError);
      else alert(t + e + n)
    },
    showTip: function (e, t, n, o) {
      t = t || 3e3, n = n || "", o = o || "";
      var a = "";
      "[object Object]" == Object.prototype.toString.call(e) ? "undefined" != typeof e.errcode ? (20002 == e.errcode && -1 === location.href.indexOf("access_token") && (a = wxLang.needLogin), a = n + "[" + e.errcode + ": " + (e.msg || wxLang.systemError) + "]" + o) : a = wxLang.systemError : a = n + e + o;
      var r = $(".tip_container");
      r[0] || (r = $("<div class='tip_container'></div>"), r.appendTo("body")), r.text(a), r.show(), setTimeout(function () {
        r.hide(), a == wxLang.needLogin && (location.href = "index.shtml")
      }, t)
    },
    _parseURL: function (e) {
      var t = document.createElement("a");
      return t.href = e, {
        source: e,
        protocol: t.protocol.replace(":", ""),
        host: t.hostname,
        port: t.port,
        query: t.search,
        params: function () {
          for (var e, n = {}, o = t.search.replace(/^\?/, "").split("&"), a = o.length, r = 0; a > r; r++) o[r] && (e = o[r].split("="), n[e[0]] = decodeURIComponent(e[1]));
          return n
        }(),
        file: (t.pathname.match(/\/([^\/?#]+)$/i) || [, ""])[1],
        hash: t.hash.replace("#", ""),
        path: t.pathname.replace(/^([^\/])/, "/$1"),
        relative: (t.href.match(/tps?:\/\/[^\/]+(.+)/) || [, ""])[1],
        segments: t.pathname.replace(/^\//, "").split("/")
      }
    },
    params: function () {
      var e = this._parseURL(window.location.href).params,
        t = $.fn.cookie("locale");
      return e.source = e.source ? e.source : "wx", e.access_token = e.access_token || $.fn.cookie("access_token") || "", e.lang = "en-us" == t ? "en" : "ru" == t ? "ru" : "zh-tw" == t ? "zh-tw" : "zh-CN", e.iswap = e.iswap || $.fn.cookie("iswap") || "false", e
    },
    defaultParams: function () {
      var e = this._parseURL(window.location.href),
        t = $.fn.cookie("locale");
      return {
        access_token: e.params.access_token || $.fn.cookie("access_token") || "",
        account: decodeURIComponent(e.params.account),
        target: decodeURIComponent(e.params.target),
        time: Math.floor((new Date).getTime() / 1e3),
        access_type: "inner",
        map_type: e.params.map_type || "BAIDU",
        source: "wx",
        lang: "en-us" == t ? "en" : "ru" == t ? "ru" : "zh-CN"
      }
    },
    serialize: function (e) {
      e = e || this.defaultParams(), "true" == $.fn.cookie("iswap") && delete e.access_token;
      var t = new RegExp("\\+", "g");
      return $.param(e).replace(t, "%20")
    },
    dateFormat: function (e, t, n) {
      return "[object Date]" != Object.prototype.toString.call(e) && 10 != ("" + e).length && "" + e.length != 13 ? "" : ("[object Number]" == Object.prototype.toString.call(e) ? 10 == ("" + e).length && (e = new Date(1e3 * e)) : "[object String]" == Object.prototype.toString.call(e) && 10 == e.length && (e = new Date(+(e + "000"))), n = n ? "getUTC" : "get", t = t ? t : "%y-%M-%d %h:%m:%s", t.replace(/%[yMdhms]/g, function (t) {
        switch (t) {
          case "%y":
            return e[n + "FullYear"]();
          case "%M":
            t = 1 + e[n + "Month"]();
            break;
          case "%d":
            t = e[n + "Date"]();
            break;
          case "%h":
            t = e[n + "Hours"]();
            break;
          case "%m":
            t = e[n + "Minutes"]();
            break;
          case "%s":
            t = e[n + "Seconds"]();
            break;
          case "%ms":
            t = e[n + "Milliseconds"]();
            break;
          default:
            return t.slice(1)
        }
        return ("0" + t).slice(-2)
      }))
    },
    getAddress: function (e, t, n) {
      return 0 == e || 0 == t ? void n(wxLang.noAddress) : void $.ajax({
        url: goome.wx.config.apiUrl + "tool/address?lng=" + e + "&lat=" + t,
        data: goome.wx.utils.params(),
        dataType: "jsonp",
        success: function (e) {
          n(e && 0 === e.errcode ? e.data.address || "" : wxLang.noAddress)
        },
        error: function (e) {
          goome.wx.utils.showTip(e)
        }
      })
    },
    distance: function (e, t, n, o, a) {
      var r = 6378.137,
        i = (n - e) * Math.PI / 180,
        c = (o - t) * Math.PI / 180,
        s = Math.sin(i / 2) * Math.sin(i / 2) + Math.cos(e * Math.PI / 180) * Math.cos(n * Math.PI / 180) * Math.sin(c / 2) * Math.sin(c / 2),
        p = 2 * Math.atan2(Math.sqrt(s), Math.sqrt(1 - s)),
        d = r * p;
      return d + a
    },
    androidClickBug: function () {
      var e = 1;
      return function () {
        var t = (new Date).getTime(),
          n = t - e;
        return e = t, 200 > n
      }
    }(),
    encode: function (e) {
      for (var t = "", n = 0, o = e.length; o > n; n++) t += String.fromCharCode(32 ^ e.charCodeAt(n));
      return t
    },
    getDirection: function (e) {
      return 22.5 >= e || e >= 337.5 ? "北" : e > 22.5 && 67.5 > e ? "东北" : e >= 67.5 && 112.5 >= e ? "东" : e > 112.5 && 157.5 > e ? "东南" : e >= 157.5 && 202.5 >= e ? "南" : e > 202.5 && 247.5 > e ? "西南" : e >= 247.5 && 292.5 >= e ? "西" : e > 292.5 && 337.5 > e ? "西北" : ""
    }
  },
  function () {
    function e() {
      try {
        WeixinJSBridge.call("hideToolbar")
      } catch (e) {}
    }
    "undefined" == typeof WeixinJSBridge ? document.addEventListener ? document.addEventListener("WeixinJSBridgeReady", e, !1) : document.attachEvent && (document.attachEvent("WeixinJSBridgeReady", e), document.attachEvent("onWeixinJSBridgeReady", e)) : e()
  }(),
  function () {
    try {
      ("true" === goome.wx.utils.params().debug || goome.wx.config.debug === !0) && $(document).ready(function () {
        var e = document.createElement("script");
        e.src = "http://192.168.1.72:7070/target/target-script-min.js#ecar-new-wx", $("body").append(e)
      })
    } catch (e) {}
  }();